#ifndef _PARAMETER_PLL_H
#define _PARAMETER_PLL_H
#include <lib/cassert.h>
#include "parameter.h"

typedef struct pll_config {
	uint32_t magic;
	uint32_t version;
	uint32_t size;
	uint8_t rev1[4];
	uint32_t core_pll;
	uint32_t noc_pll;
	uint32_t lmu_pll;
	uint32_t fio_pll;
	uint32_t gmu_pll;
	uint32_t dmm_pll;
	uint32_t scto_pll;
}__attribute__((aligned(sizeof(unsigned long)))) pll_config_t;

/*
*	结构体变量偏移与参数配置说明中必须相同
*/
#define PLL_MAGIC_OFFSET					0x0
#define PLL_CORE_PLL_OFFSET					0x10
#define PLL_NOC_PLL_OFFSET					0x14
#define PLL_LMU_PLL_OFFSET					0x18
#define PLL_FIO_PLL_OFFSET					0x1C
#define PLL_GMU_PLL_OFFSET					0x20
#define PLL_DMM_PLL_OFFSET					0x24
#define PLL_SCTO_PLL_OFFSET					0x28

#define CP_CASSERT( offset, _member)						\
	 CASSERT(offset ==										\
		 __builtin_offsetof(pll_config_t, _member),			\
		 assert_##_member##_mismatch)

CP_CASSERT(PLL_MAGIC_OFFSET, magic);
CP_CASSERT(PLL_CORE_PLL_OFFSET, core_pll);
CP_CASSERT(PLL_NOC_PLL_OFFSET, noc_pll);
CP_CASSERT(PLL_LMU_PLL_OFFSET, lmu_pll);
CP_CASSERT(PLL_FIO_PLL_OFFSET, fio_pll);
CP_CASSERT(PLL_GMU_PLL_OFFSET, gmu_pll);
CP_CASSERT(PLL_DMM_PLL_OFFSET, dmm_pll);
CP_CASSERT(PLL_SCTO_PLL_OFFSET, scto_pll);

#endif

